package com.wsc.castle.ui.fragments.base;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.wsc.castle.R;
import com.wsc.castle.model.KModel;
import com.wsc.castle.model.KRuntimeModel;
import com.wsc.castle.utils.DialogUtils;

public class BaseFragment extends android.support.v4.app.Fragment {
	protected View view;
	protected KModel model = KModel.getInstance();
	protected KRuntimeModel runtime = KRuntimeModel.getInstance();

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		view = inflater.inflate(R.layout.fragment_game, container, false);
		init();
		return view;
	}
	
	public void init() {
		initComponents();
		initValues();
		initListeners();
	}

	public void initComponents() {

	}

	public void initValues() {

	}

	public void initListeners() {
	}

	public void showExceptionAsDialog(final Exception e) {
		DialogUtils.showException(getActivity(), e);
	}
}
